<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>AFC设备维修系统-用户信息详情</title>
		<style>
			#organizesTree {margin-top: 10px;border: 1px solid #617775;background: #f0f6e4;min-width:180px;max-height:400px;overflow-y:scroll;overflow-x:auto;}
		</style>
	</head>

	<body>
	<jsp:include page="/jsp/common/top.jsp"></jsp:include>


		<!-- 顶部start -->
		<div id="main">
			<div class="body">
				<!-- 导航菜单 -->
			<jsp:include page="/jsp/common/nav.jsp"></jsp:include>
				<!-- 主体 -->
				<div class="main_body">
					<form action="" method="post">
						
				<table class="condition" style="width:100%; font-size:14px; font-weight:bold; color:#000000;" align="center">
					<tr>
						<td><s:if test="%{null != userInfo}">
							<input type="button" class="btn-title" value="新增" onclick="javascript:window.location.href='toUserInfoAdd.action';" />
							&nbsp;&nbsp;&nbsp;
							<input type="button" class="btn-title" value="编辑" onclick="javascript:window.location.href='toUserInfoEdit.action?userInfo.id=${userInfo.id}';" />
							&nbsp;&nbsp;&nbsp;
							<input type="button" class="btn-title" value="删除" onclick="del('${userInfo.userCode}');" />
							&nbsp;&nbsp;&nbsp;</s:if>
							<input type="button" class="btn-title" value="返回" onclick="javascript:window.location.href='userInfoList.action';" />
						</td>
					</tr>
				</table>
			
			<div id="add_div">
		
						<table class="table_add" style="width: 100%;">
							<s:if test="%{null ==userInfo}">
							<tr>
								<th style="width: 150px; text-align: center;" colspan="3">
									<font color="red"> 该条记录不存在或已删除！</font>									
								</th>
							</tr>
							</s:if>
							<s:else>
							<tr>
								<th style="width: 150px;">
									用户账号：
								</th>
								<td style="width: 225px;">
									${userInfo.userCode }
								</td>
								<th style="width: 189px;">
									用户名：
								</th>
								<td>
									${userInfo.userName }
								</td>
							</tr>
							<tr>
								<th style="width: 150px;">
									用户密码：
								</th>
								<td style="width: 225px;">
									${userInfo.password}
								</td>
								<th style="width: 150px;">
									邮箱：
								</th>
								<td style="width: 225px;">
									${userInfo.email }
								</td>
							</tr>
							<tr>
								<th style="width: 150px;">
									角色：
								</th>
								<td style="width: 225px;">
								${userInfo.roleName}
								</td>
								<th style="width: 189px;">
									所属组织：
								</th>
								<td style="width: 225px;">
								${userInfo.blongOrgName }
								</td>
							</tr>
							
							<tr>
								<th style="width: 150px;">
									用户号码：
								</th>
								<td style="width: 225px;">
									${userInfo.telephoneNum}
								</td>
								<th style="width: 189px;">
									&nbsp;
								</th>
								<td style="width: 225px;">
									&nbsp;
								</td>
							</tr>
 						</s:else>
						</table>
					</div>
			</form>
				</div>
			</div>
		</div>
		
		<!-- 顶部end -->
	<jsp:include page="/jsp/common/bottom.jsp"></jsp:include>
	
	<script type="text/javascript">
		//设置高亮
			$(function(){
		        //selectNav('nav1');
		    });
		    	//删除
			function del(accountid){
				var url = encodeURI(encodeURI('deleteUser.action?userInfo.userCode=' + accountid));
				if(confirm('确定删除此用户？')){
					$.ajax({
				        url: url,
				        type:"POST",
				        cache:false,
				        success: function(message){
					    	if(message == "success"){
				        		alert("删除成功！");
				        		window.location.href="userInfoList.action";
				        	}else if(message=="error"){
								window.location.href="goError.action";
							}else{
					    		alert('删除失败！');
				        	}
				   		}
			     	});
				}
			}
			
	</script>
	</body>
</html>
